array([0., 0., 0., 0., 0.])
2025-03-04
for-loops)Different data types (dtype) are valid
type followed by bit (8, 16, 32, 64, 128)
spike_simulationnp.random.seed(42)
A = np.random.normal(5, 2, 20)
A = A.reshape(2, 5, 2)
print(A)
print(np.shape(A))[[[5.99342831 4.7234714 ]
[6.29537708 8.04605971]
[4.53169325 4.53172609]
[8.15842563 6.53486946]
[4.06105123 6.08512009]]
[[4.07316461 4.06854049]
[5.48392454 1.17343951]
[1.55016433 3.87542494]
[2.97433776 5.62849467]
[3.18395185 2.1753926 ]]]
(2, 5, 2)
2:10:2)0.2linspace and logspacenanWhat could this be?
\(sin(250 x) \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x - \mu)^2}{2\sigma^2}}\)
import matplotlib.pyplot as plt
time = np.linspace(start=0, stop=0.5, num=2000)
mu, sigma = 0.25, 0.01
sinewave = np.sin(time * 250 * np.pi)
gaussian = (1 / (np.sqrt(2 * np.pi * np.square(sigma))) *
np.exp(-(np.square(time - mu) /np.square(2 * sigma))))
plt.plot(time, gaussian * sinewave)
plt.show()